package com.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.project.bean.BuyerCarBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface IBuyerCarMapper extends BaseMapper<BuyerCarBean> {
    @Select("SELECT tb.*,tp.* FROM t_buyerCar tb,t_product tp WHERE " +
            "tb.`fk_productId` = tp.`pk_productId` AND tb.`fk_userId`= #{userId};")
    @ResultMap("buyerCarMap")
    List<BuyerCarBean> findByUserId(Integer userId);
}
